<template>
  <el-row>
    <el-col :span="24">
      <!-- user卡片 -->
      <el-card>
        <div class="user">
          <img src="@/assets/images/user.png" alt="" />
          <div class="userInfo">
            <p div class="name">{{ userInfo.userName }}</p>
            <p div class="access">{{ types[userInfo.userPermission] }}</p>
          </div>
        </div>
        <div class="loginInfo">
          <p>上次登录时间：<span>未知</span></p>
          <p>上次登陆地点：<span>未知</span></p>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>

<script>
export default {
  data() {
    return {
      types: ["普通用户", "管理员", "超级管理员"],
      userInfo: {
        userName: "-",
        userPermission: 2,
      },
    };
  },
  methods: {
    priceFormate(price) {
      return "￥" + price;
    },
  },
  mounted() {
    const info = JSON.parse(localStorage.getItem("userInfo") || null);
    if (info) {
      this.userInfo = info;
    }
  },
};
</script>

<style lang="less" scoped>
@import "./Info.less";
</style>
